<link rel="stylesheet/less" type="text/css" href="./bricks/component/menu/menu.less"/>
<link rel="stylesheet/less" type="text/css" href="./bricks/component/header/header.less"/>

<!--ub-header-c start-->
<header class="ub-header-c">
    <div class="menu">
        <a href="javascript:;" class="item-icon" data-repeat="3">
            <div class="icon">
                <i class="iconfont icon-home"></i>
            </div>
            <div class="text">导航{SEQ}</div>
        </a>
        <a class="item" href="#">
            <i class="iconfont icon-user"></i>
            登录
        </a>
    </div>
    <div class="logo">
        <a class="logo-link" href="#">
            <img class="logo-image" data-src="placeholder/400x100"/>
        </a>
    </div>
    <div class="search">
        <div class="box">
            <form action="#" method="get">
                <input class="input" type="text" name="keyword" placeholder="搜索内容"/>
                <button class="submit" type="submit">
                    <i class="iconfont icon-search"></i>
                    搜索
                </button>
            </form>
        </div>
    </div>
    <div class="menu-mask" onclick="$(this).closest('.ub-header-c').removeClass('show')"></div>
    <a class="menu-toggle" href="javascript:;" onclick="$(this).closest('.ub-header-c').toggleClass('show')">
        <i class="show iconfont icon-list"></i>
        <i class="close iconfont icon-close"></i>
    </a>
    <div class="search-mask" onclick="$(this).closest('.ub-header-c').removeClass('show-search')"></div>
    <a class="search-toggle" href="javascript:;" onclick="$(this).closest('.ub-header-c').toggleClass('show-search')">
        <i class="show iconfont icon-search"></i>
        <i class="close iconfont icon-close"></i>
    </a>
</header>
<div class="ub-header-c-placeholder"></div>
<!--ub-header-c end-->

<div class="ub-menu-layout">
    <a class="toggle" href="javascript:;" onclick="$('body').toggleClass('ub-menu-layout-shrink')">
        <i class="iconfont icon-list"></i>
    </a>
    <div class="body">
        <a class="item item-main active" href="javascript:;">
            <i class="icon iconfont icon-home"></i>
            <span class="text">首页</span>
        </a>
        <a class="item item-main" href="javascript:;" data-repeat="3">
            <i class="icon iconfont icon-home"></i>
            <span class="text">导航{SEQ}</span>
        </a>
        <div class="item-title">频道</div>
        <a class="item" href="javascript:;" data-repeat="10">
            <i class="icon iconfont icon-home"></i>
            <span class="text">导航{SEQ}</span>
        </a>
        <div class="foot">
            <div class="link">
                <a href="javascript:;" data-repeat="6">关于我们</a>
            </div>
            <div class="copy">
                <a href="https://beian.miit.gov.cn/" target="_blank">[备案号]</a>
            </div>
        </div>
    </div>
</div>

<div class="ub-menu-layout-container">
    <div style="padding:1rem;">
        <div class="row">
            <div class="col-4">
                <div>
                    .ub-menu
                    <a href="./page.html?url=component/menu/menu-page-menu" target="_blank">
                        .page-menu
                    </a>
                </div>
                <div class="ub-menu" data-menu>
                    <div class="title">标题1</div>
                    <div class="items">
                        <a class="active" href="#">标题1-1</a>
                        <a href="#">标题1-2</a>
                    </div>
                    <div class="title">标题2</div>
                    <div class="items">
                        <a href="#">标题2-1</a>
                        <a href="#">标题2-2</a>
                    </div>
                    <div class="title">标题3</div>
                    <div class="items">
                        <a href="#">标题3-1</a>
                        <a href="#">标题3-2</a>
                    </div>
                </div>
                <script>
                    $(function () {
                        $('[data-menu]').on('click','.title',function(){
                            $(this).next().toggleClass('open');
                        });
                    });
                </script>
            </div>
            <div class="col-4">
                <div>.ub-menu.simple 简单水平滚动菜单</div>
                <div class="ub-menu simple">
                    <a class="title active" href="javascript:;">菜单</a>
                    <a class="title" href="javascript:;" data-repeat="5">{ZH,4,100}</a>
                </div>
            </div>
            <div class="col-4">
                <div>
                    <div>
                        .ub-menu.nav-menu
                        <a href="javascript:;" onclick="$('[data-menu-nav-menu]').toggleClass('lg')">
                            .lg
                        </a>
                    </div>
                    <div class="ub-menu nav-menu" data-menu-nav-menu>
                        <div class="title">
                            <a href="#">标题1</a>
                        </div>
                        <div class="items">
                            <a class="active" href="#">标题1-1</a>
                            <a href="#">标题1-2</a>
                        </div>
                        <div class="title active">标题2</div>
                        <div class="items">
                            <a href="#">标题2-1</a>
                            <a href="#">标题2-2</a>
                        </div>
                        <div class="title">标题3</div>
                        <div class="items">
                            <a href="#">标题3-1</a>
                            <a href="#">标题3-2</a>
                        </div>
                        <a class="page-menu-toggle" href="javascript:;"
                           onclick="$('body').toggleClass('ub-menu-page-show')">
                            <i class="icon iconfont icon-list"></i>
                        </a>
                    </div>
                    <script>
                        $(function () {
                            var $menu = $('[data-menu-nav-menu]');
                            if($(window).width()>600) {
                                $menu.find('.items').addClass('open');
                            }else{
                                $menu.on('click','.title',function(){
                                    $menu.find('.items').removeClass('open');
                                    $(this).next().addClass('open')
                                        .css('left',$(this).offset().left+'px')
                                        .css('width',$(this).width()+'px');
                                    return false;
                                });
                                $(document).on('click',function(){
                                    $menu.find('.items').removeClass('open');
                                });
                            }
                        });
                    </script>
                </div>
            </div>
            <div class="col-4">
                <div>
                    .ub-menu-tree
                    <a href="javascript:;" onclick="$('[data-menu-tree]').toggleClass('no-arrow')">
                        .no-arrow
                    </a>
                    <a href="./page.html?url=component/menu/menu-tree-page-menu" target="_blank">
                        .page-menu
                    </a>
                </div>
                <div class="ub-menu-tree" data-menu-tree>
                    <div class="item" data-repeat="2">
                        <div class="title">
                            <a class="title-text" href="javascript:;">菜单 {ZH,1,100}</a>
                            <div class="title-action">
                                <a href="javascript:;" class="title-action-icon title-action-icon-open">
                                    <i class="iconfont icon-angle-right"></i>
                                </a>
                                <a href="javascript:;" class="title-action-icon title-action-icon-close">
                                    <i class="iconfont icon-angle-down"></i>
                                </a>
                            </div>
                        </div>
                        <div class="group">
                            <div class="item" data-repeat="2">
                                <div class="title">
                                    <a class="title-text" href="javascript:;">菜单 {ZH,2,100}</a>
                                    <div class="title-action">
                                        <a href="javascript:;" class="title-action-icon title-action-icon-open">
                                            <i class="iconfont icon-angle-right"></i>
                                        </a>
                                        <a href="javascript:;" class="title-action-icon title-action-icon-close">
                                            <i class="iconfont icon-angle-down"></i>
                                        </a>
                                    </div>
                                </div>
                            </div>
                            <div class="item" data-repeat="2">
                                <div class="title">
                                    <a class="title-text" href="javascript:;">菜单 {ZH,3,100}</a>
                                    <div class="title-action">
                                        <a href="javascript:;" class="title-action-icon title-action-icon-open">
                                            <i class="iconfont icon-angle-right"></i>
                                        </a>
                                        <a href="javascript:;" class="title-action-icon title-action-icon-close">
                                            <i class="iconfont icon-angle-down"></i>
                                        </a>
                                    </div>
                                </div>
                                <div class="group">
                                    <div class="item" data-repeat="2">
                                        <div class="title">
                                            <a class="title-text" href="javascript:;">菜单 {ZH,40,400}</a>
                                            <div class="title-action">
                                                <a href="javascript:;" class="title-action-icon title-action-icon-open">
                                                    <i class="iconfont icon-angle-right"></i>
                                                </a>
                                                <a href="javascript:;" class="title-action-icon title-action-icon-close">
                                                    <i class="iconfont icon-angle-down"></i>
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <script>
                    $(function () {
                        $('[data-menu-tree]').find('.title.active').parents('.group').prev().addClass('open group-active');
                        $('[data-menu-tree]').on('click','.title-action-icon',function(){
                            $(this).closest('.title').toggleClass('open');
                        });
                    });
                </script>
            </div>


            <div class="col-4">
                <div>
                    .ub-menu-tree-simple
                </div>
                <div class="ub-menu-tree-simple">
                    <div class="item-container">
                        <div data-repeat="2" class="item level-1">
                            <a href="javascript:;">{ZH,2,100}</a>
                        </div>
                        <div data-repeat="2" class="item level-2">
                            <a href="javascript:;">{ZH,2,100}</a>
                        </div>
                        <div data-repeat="3" class="item level-2">
                            <a href="javascript:;">{ZH,2,100}</a>
                        </div>
                        <div data-repeat="4" class="item level-2">
                            <a href="javascript:;">{ZH,2,100}</a>
                        </div>
                        <div data-repeat="2" class="item level-2">
                            <a href="javascript:;">{ZH,2,100}</a>
                        </div>
                    </div>
                    <div class="tool" onclick="$(this).closest('.ub-menu-tree-simple').toggleClass('close')">
                        <a href="javascript:;" class="tool-close">
                            <i class="iconfont icon-angle-up"></i>
                        </a>
                        <a href="javascript:;" class="tool-open">
                            <i class="iconfont icon-angle-down"></i>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


